<!DOCTYPE html>

<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>第二个Vue程序</title>
        <script src="https://unpkg.com/vue@next"></script>
    </head>
    <body>

        <div class="second"></div>

        <script type="text/javascript">

            const options = {
                /* 模版可以书写在 HTML 元素中，也可以使用 template 来指定 */
                template: `<input type="text" v-model="username">
                           <p>{{ username }}</p>`,
                data: function(){
                    let x = {
                        username: 'kaifamiao'
                    }
                    return x ;
                }
            }

            const app = Vue.createApp( options );
            const vm = app.mount( '.second' );
            console.log( 'view-model' , vm );
        </script>
        
    </body>
</html>